using System;
using System.ComponentModel;
using System.Transactions;

using SIS.ENT;
using SIS.DAL;


/// <summary>
/// The EmployeeJobExperiencesTableManager class is responsible for managing BO.EmployeeJobExperiencesTable objects in the system.
/// </summary>
[DataObjectAttribute()]
public class EmployeeJobExperiencesTableManager
  {

#region "Public Methods"

/// <summary>
/// Gets a list with all EmployeeJobExperiencesTable objects in the database.
/// </summary>
/// <returns>A list with all EmployeeJobExperiencesTable from the database when the database contains any, or null otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, true)]
public static EmployeeJobExperiencesTableList GetList(){
return EmployeeJobExperiencesTableDB.GetList();
}

[DataObjectMethod(DataObjectMethodType.Select, true)]
public static EmployeeJobExperiencesTableList GetListByUserAccountKey(int UserAccountKey)
{
    return EmployeeJobExperiencesTableDB.GetListByUserAccountKey(UserAccountKey);
}


/// <summary>
/// Gets a single EmployeeJobExperiencesTable from the database without its data.
/// </summary>
/// <param name="employeeJobExperienceKey">The EmployeeJobExperienceKey of the EmployeeJobExperiencesTable in the database.</param>
/// <returns>A EmployeeJobExperiencesTable object when the EmployeeJobExperienceKey exists in the database, or <see langword="null"/> otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static EmployeeJobExperiencesTable GetItem(int employeeJobExperienceKey){
return GetItem(employeeJobExperienceKey, false);
}

/// <summary>
/// Gets a single EmployeeJobExperiencesTable from the database.
/// </summary>
/// <param name="employeeJobExperienceKey">The EmployeeJobExperienceKey of the EmployeeJobExperiencesTable in the database.</param>
/// <param name="getEmployeeJobExperiencesTableRecords">Determines whether to load all associated EmployeeJobExperiencesTable records as well.</param>
/// <returns>
/// A EmployeeJobExperiencesTable object when the EmployeeJobExperienceKey exists in the database, or <see langword="null"/> otherwise.
/// </returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static EmployeeJobExperiencesTable GetItem(int employeeJobExperienceKey, bool getEmployeeJobExperiencesTableRecords){
EmployeeJobExperiencesTable myEmployeeJobExperiencesTable = EmployeeJobExperiencesTableDB.GetItem(employeeJobExperienceKey);
return myEmployeeJobExperiencesTable;
}

/// <summary>
/// Saves a EmployeeJobExperiencesTable in the database.
/// </summary>
/// <param name="myEmployeeJobExperiencesTable">The EmployeeJobExperiencesTable instance to save.</param>
/// <returns>The new EmployeeJobExperienceKey if the EmployeeJobExperiencesTable is new in the database or the existing EmployeeJobExperienceKey when an item was updated.</returns>
[DataObjectMethod(DataObjectMethodType.Update, true)]
public static int Save(EmployeeJobExperiencesTable myEmployeeJobExperiencesTable){
using (TransactionScope myTransactionScope = new TransactionScope()){
int employeeJobExperiencesTableEmployeeJobExperienceKey = EmployeeJobExperiencesTableDB.Save(myEmployeeJobExperiencesTable);

//  Assign the EmployeeJobExperiencesTable its new (or existing EmployeeJobExperienceKey).
myEmployeeJobExperiencesTable.EmployeeJobExperienceKey = employeeJobExperiencesTableEmployeeJobExperienceKey;

myTransactionScope.Complete();

return employeeJobExperiencesTableEmployeeJobExperienceKey;
}
}

/// <summary>
/// Deletes a EmployeeJobExperiencesTable from the database.
/// </summary>
/// <param name="myEmployeeJobExperiencesTable">The EmployeeJobExperiencesTable instance to delete.</param>
/// <returns>Returns true when the object was deleted successfully, or false otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(EmployeeJobExperiencesTable myEmployeeJobExperiencesTable){
return EmployeeJobExperiencesTableDB.Delete(myEmployeeJobExperiencesTable.EmployeeJobExperienceKey);
}

[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(int EmployeeJobExperienceKey)
{
    return EmployeeJobExperiencesTableDB.Delete(EmployeeJobExperienceKey);
}

#endregion

}

